import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
import VueSetupExtend from 'vite-plugin-vue-setup-extend'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(), VueSetupExtend()],
  resolve: {    
    alias: {      
      '@': resolve(__dirname, 'src'), // 设置 `@` 指向 `src` 目录
      // 'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js'
    }  
  },
  server: {
    open: true,
    host:'0.0.0.0', // 设置本地Network
    proxy: {
      "/api": {
        // target: 'http://192.168.0.121:5173',
        target: 'http://127.0.0.1:3007', // 本地服务器
        // target: 'http://192.168.43.153:5173', // 本地服务器
        changeOrigin: true,
        secure: false,
        // rewrite: path => path.replace(/^\/api/, '')
      },
    },
  },
})
